/*
 * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @Date: 2023-05-04 23:14:25
 * @LastEditors: zt 2993721164@qq.com
 * @LastEditTime: 2025-07-31 15:12:47
 * @FilePath: /yyshort-master/lib/common/middlewares/router_welcome.dart
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import 'package:flutter/material.dart';
import 'package:yyshort/common/apis/user_api.dart';
import 'package:yyshort/common/model/user.dart';
import 'package:yyshort/common/routers/routes.dart';
import 'package:yyshort/common/store/store.dart';

import 'package:get/get.dart';

/// 第一次欢迎页面
class RouteWelcomeMiddleware extends GetMiddleware {
  // priority 数字小优先级高
  @override
  int? priority = 0;

  RouteWelcomeMiddleware({required this.priority});

  @override
  RouteSettings? redirect(String? route) {
    if (ConfigStore.to.isFirstOpen == true) {
      return null;
    } else {
      //  if (UserStore.to.isLogin == true)
      return RouteSettings(name: AppRoutes.SplashScreen);
    }
  }
}
